package com.zongxingh.falcon.logger.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * Introduction:  日志的配置类，可配置日志输出级别、日志输出的字段
 * Package Name:  com.zongxingh.falcon.logger.config
 * Project Name:  falcon-logger
 * Author:  zongxingh
 * Email： zongxingh@163.com
 * Tel: 157*****778
 * Create Time:  2020/10/25 19:11
 */
@Component
@ConfigurationProperties(prefix = LoggerProperties.PREFIX)
public class LoggerProperties {
    public static final String PREFIX = "falcon.logger";

    private String level;

    private Formatter formatter;

    public String getLevel() {
        return level;
    }

    public void setLevel(String level) {
        this.level = level;
    }

    public Formatter getFormatter() {
        return formatter;
    }

    public void setFormatter(Formatter formatter) {
        this.formatter = formatter;
    }

    public class Formatter {

        private boolean logLevel;
        private boolean threadName;
        private String timeStampFormatter;
        private boolean hostIp;
        private boolean serviceName;

        public boolean isLogLevel() {
            return logLevel;
        }

        public void setLogLevel(boolean logLevel) {
            this.logLevel = logLevel;
        }

        public boolean isThreadName() {
            return threadName;
        }

        public void setThreadName(boolean threadName) {
            this.threadName = threadName;
        }

        public String getTimeStampFormatter() {
            return timeStampFormatter;
        }

        public void setTimeStampFormatter(String timeStampFormatter) {
            this.timeStampFormatter = timeStampFormatter;
        }

        public boolean isHostIp() {
            return hostIp;
        }

        public void setHostIp(boolean hostIp) {
            this.hostIp = hostIp;
        }

        public boolean isServiceName() {
            return serviceName;
        }

        public void setServiceName(boolean serviceName) {
            this.serviceName = serviceName;
        }
    }
}
